package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "CUSTOMER")
public class Customer extends Lead implements Serializable {

    @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
    private Collection<Address> addresses;
    private String type;
    private Boolean assigned = false;
    @OneToOne(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
    private Credit credit;

    public Customer() {
    }

    public Customer(Employee employee, String email, String firstName, String lastName, String company, String title, String status, Integer phone, Address companyAddress, Double revenue, String description,
            Integer numEmployee, String industry, ArrayList<Address> addresses, String type, Boolean assigned) {

        this.setEmployee(employee);
        this.setEmail(email);
        this.setFirstName(firstName);
        this.setLastName(lastName);
        this.setCompany(company);
        this.setTitle(title);
        this.setStatus(status);
        this.setPhone(phone);
        this.setCompanyAddress(companyAddress);
        this.setRevenue(revenue);
        this.setDescription(description);
        this.setNumEmployee(numEmployee);
        this.setIndustry(industry);
        this.addresses = addresses;
        this.type = type;
        this.assigned = assigned;
    }

    /**
     * @return the billingAddresses
     */
    public Collection<Address> getAddresses() {
        return addresses;
    }

    /**
     * @param billingAddresses the billingAddresses to set
     */
    public void setAddresses(Collection<Address> addresses) {
        this.addresses = addresses;
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * @return the assigned
     */
    public Boolean getAssigned() {
        return assigned;
    }

    /**
     * @param assigned the assigned to set
     */
    public void setAssigned(Boolean assigned) {
        this.assigned = assigned;
    }

    /**
     * @return the credit
     */
    public Credit getCredit() {
        return credit;
    }

    /**
     * @param credit the credit to set
     */
    public void setCredit(Credit credit) {
        this.credit = credit;
    }
}
